/**
 *  路由文件
 *  引入[Vue, VueRouter]模块
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
/**
 *  加载模块
 */
Vue.use(VueRouter)

/**
 *  配置路由
 */
const router = new VueRouter({
    routes: [{ //主页面
            path: '/home',
            name: 'home',
            title: 'home',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/home.vue'], resolve)
            }
        },
        { //登录页面
            path: '/device_list',
            name: 'device_list',
            title: '设备列表',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/device_list.vue'], resolve)
            }
        },
        { //房间列表
            path: '/room_list',
            name: 'room_list',
            title: '设备列表',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/room_list.vue'], resolve)
            }
        },
        { //个人中心页面
            path: '/userInfo',
            name: 'userInfo',
            title: 'userInfo',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/index.vue'], resolve)
            }
        },
        { //个人中心页面
            path: '/status',
            name: 'status',
            title: 'status',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/status.vue'], resolve)
            }
        },
        { //设置界面
            path: '/setting_option',
            name: 'setting_option',
            title: 'setting_option',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/setting_option.vue'], resolve)
            }
        },
          { //设置界面
            path: '/tree',
            name: 'tree',
            title: 'tree',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/tree.vue'], resolve)
            }
        },
        { //登录页面
            path: '/status',
            name: 'status',
            title: 'status',
            meta: {
                requireAuth: true,
            },
            component: function(resolve) {
                require(['./components/status.vue'], resolve)
            }
        },

    ]
})

export default router
